JBoss Community Archive (Read Only)

Teiid 8.8

Archetype Template Connector Project

One way to start developing a custom connector (resource-adapter) is to create a project using the Teiid archetype template. When the project is created from the template, it will contain the essential classes and resources for you to begin adding your custom logic. Additionally, the maven dependencies are defined in the pom.xml so that you can begin compiling the classes.

To create your custom connector project, you can run the following from the command line:

mvn archetype:generate                                  \
  -DarchetypeGroupId=org.jboss.teiid.arche-types               \
  -DarchetypeArtifactId=connector-archetype          \
  -DarchetypeVersion=8.6.0               \
  -DgroupId=${groupId}   				\
  -DartifactId=connector-${connector-name}	\
  -Dpackage=org.teiid.resource.adapter.${connector-name}    \
  -Dversion=8.7.0.Alpha1-SNAPSHOT    \
  -Dconnector-name=${connector-name}   \
  -Dvendor-name=MyVendor

where:

  -DarchetypeGroupId    -  is the group ID for the arche type to use to generate
  -DarchetypeArtifactId -  is the artifact ID for the arche type to use to generate
  -DarchetypeVersion	-  is the version for the arche type to use to generate
  -DgroupId		-  (user defined) group ID for the new connector project pom.xml
  -DartifactId		-  (user defined) artifact ID for the new connector project pom.xml
  -Dpackage		-  (user defined) the package structure where the java and resource files will be created
  -Dversion		-  (user defined) the version for the new connector project pom.xml
  -Dconnector-name	-  (user defined) the name (type) of the new connector project, used to create the java class names and rar
  -Dvendor-name		-  name of the Vendor for the data source, updates the rar

The following is an example:

mvn archetype:generate     -                             \
  -DarchetypeGroupId=org.jboss.teiid.arche-types              \
  -DarchetypeArtifactId=connector-archetype          \
  -DarchetypeVersion=8.6.0   	\
  -DgroupId=org.jboss.teiid.connectors   	\
  -Dpackage=org.teiid.resource.adapter.myType    \
  -DartifactId=connector-myType	\
  -Dversion=8.7.0.Alpha2-SNAPSHOT    \
  -Dconnector-name=myType   \
  -Dvendor-name=MyVendor

When executed, you will be asked to confirm the properties

Confirm properties configuration:
groupId: org.jboss.teiid.connectors
artifactId: connector-myType
version: 8.7.0.Alpha1-SNAPSHOT
package: org.teiid.resource.adapter.myType
connector-name: myType
vendor-name: MyVendor
 Y: : 

type Y (yes) and press enter, and the creation of the connector project will be done

Upon creation, a directory based on the artifactId will be created, that will contain the project. Note: The project will not compile because the ${connector-name}Connection interface in the ConnectionImpl has not been added as a dependency in the pom.xml. This will need to be done.

Now you are ready to start adding your custom code.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 13:01:37 UTC, last content change 2014-07-17 12:34:02 UTC.